package com.wang.designpattern.proxy.staticproxy;

/**
 * 代理对象，静态代理
 */
public class TeacherDaoProxy implements ITeacherDao {

    // 目标对象，通过接口来聚合
    private ITeacherDao teacherDao;

    // 构造器
    public TeacherDaoProxy(ITeacherDao teacherDao) {
        this.teacherDao = teacherDao;
    }

    @Override
    public void teach() {
        System.out.println("开始代理。。。");
        teacherDao.teach();
        System.out.println("提交。。。");
    }
}
